package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysUserBankMapper;
import com.ruoyi.project.system.domain.SysUserBank;
import com.ruoyi.project.system.service.ISysUserBankService;

/**
 * 用户银行卡Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-17
 */
@Service
public class SysUserBankServiceImpl implements ISysUserBankService 
{
    @Autowired
    private SysUserBankMapper sysUserBankMapper;

    /**
     * 查询用户银行卡
     * 
     * @param bankId 用户银行卡ID
     * @return 用户银行卡
     */
    @Override
    public SysUserBank selectSysUserBankById(Long bankId)
    {
        return sysUserBankMapper.selectSysUserBankById(bankId);
    }

    /**
     * 查询用户银行卡列表
     * 
     * @param sysUserBank 用户银行卡
     * @return 用户银行卡
     */
    @Override
    public List<SysUserBank> selectSysUserBankList(SysUserBank sysUserBank)
    {
        return sysUserBankMapper.selectSysUserBankList(sysUserBank);
    }

    /**
     * 新增用户银行卡
     * 
     * @param sysUserBank 用户银行卡
     * @return 结果
     */
    @Override
    public int insertSysUserBank(SysUserBank sysUserBank)
    {
        sysUserBank.setCreateTime(DateUtils.getNowDate());
        return sysUserBankMapper.insertSysUserBank(sysUserBank);
    }

    /**
     * 修改用户银行卡
     * 
     * @param sysUserBank 用户银行卡
     * @return 结果
     */
    @Override
    public int updateSysUserBank(SysUserBank sysUserBank)
    {
        return sysUserBankMapper.updateSysUserBank(sysUserBank);
    }

    /**
     * 批量删除用户银行卡
     * 
     * @param bankIds 需要删除的用户银行卡ID
     * @return 结果
     */
    @Override
    public int deleteSysUserBankByIds(Long[] bankIds)
    {
        return sysUserBankMapper.deleteSysUserBankByIds(bankIds);
    }

    /**
     * 删除用户银行卡信息
     * 
     * @param bankId 用户银行卡ID
     * @return 结果
     */
    @Override
    public int deleteSysUserBankById(Long bankId)
    {
        return sysUserBankMapper.deleteSysUserBankById(bankId);
    }

    @Override
    public SysUserBank queryIsbankCard(SysUserBank sysUserBank) {
        return sysUserBankMapper.queryIsbankCard(sysUserBank);
    }
}
